﻿//
// Created by francklinson on 2021/3/13.
//

#include <iostream>

int main()
{
    using namespace std;
    int higgens = 5;
    int *pt = &higgens; // pt是指向int类型数据higgens的指针 将pt初始化，而不是*pt初始化

    cout << "Value of higgens = " << higgens
         << "; Address of higgens = " << &higgens << endl;
    cout << "Value of *pt = " << *pt // pt的解引用是higgens的值
         << "; Value of pt = " << pt << endl; // pt自身的值是higgens的地址
    int **pt2;  // 指向指针pt的指针
    pt2 = &pt;
    cout << pt2 << endl; // pt2 储存的是pt的地址
    cout << *pt2 << endl; // *pt2 得到pt的值，也就是higgens的地址
    cout << **pt2 << endl; // **pt2得到higgens的值

    return 0;
}